package com.publiccms.entities.cms;

// Generated 2015-6-25 11:28:56 by Hibernate Tools 4.3.1

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.apache.lucene.analysis.standard.StandardAnalyzer;
import org.hibernate.search.annotations.Analyze;
import org.hibernate.search.annotations.Analyzer;
import org.hibernate.search.annotations.ClassBridge;
import org.hibernate.search.annotations.DateBridge;
import org.hibernate.search.annotations.Facet;
import org.hibernate.search.annotations.FacetEncodingType;
import org.hibernate.search.annotations.Field;
import org.hibernate.search.annotations.FieldBridge;
import org.hibernate.search.annotations.FullTextFilterDef;
import org.hibernate.search.annotations.Indexed;
import org.hibernate.search.annotations.Resolution;
import org.springframework.format.annotation.DateTimeFormat;

import com.publiccms.common.index.CmsContentBridge;
import com.publiccms.common.index.CmsContentInterceptor;
import com.publiccms.common.index.PublishDateFilterFactory;
import com.publiccms.common.index.StringBridge;
import com.sanluan.common.source.entity.MyColumn;

/**
 * CmsContent generated by hbm2java
 */
@Entity
@Table(name = "cms_content")
@Analyzer(impl = StandardAnalyzer.class)
@ClassBridge(impl = CmsContentBridge.class)
@FullTextFilterDef(name = "publishDate", impl = PublishDateFilterFactory.class)
@Indexed(interceptor = CmsContentInterceptor.class)
public class CmsContent implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Integer id;
	@MyColumn(title = "标题", condition = true, like = true, or = true)
	@Field
	private String title;
	@MyColumn(title = "发布用户", condition = true)
	private int userId;
	@MyColumn(title = "部门", condition = true)
	private Integer deptId;
	@MyColumn(title = "分类", condition = true)
	@Field(analyze = Analyze.NO)
	@FieldBridge(impl = StringBridge.class)
	@Facet(encoding = FacetEncodingType.STRING)
	private int categoryId;
	@MyColumn(title = "模型", condition = true)
	@Field(analyze = Analyze.NO)
	@FieldBridge(impl = StringBridge.class)
	@Facet(encoding = FacetEncodingType.STRING)
	private int modelId;
	@MyColumn(title = "父内容", condition = true)
	private Integer parentId;
	@MyColumn(title = "是否转载")
	private boolean isCopied;
	@MyColumn(title = "来源")
	private String source;
	@MyColumn(title = "来源地址")
	private String sourceUrl;
	@MyColumn(title = "作者")
	@Field(analyze = Analyze.NO)
	private String author;
	@MyColumn(title = "编辑")
	@Field
	private String editor;
	@MyColumn(title = "地址")
	private String url;
	@MyColumn(title = "描述")
	@Field
	private String description;
	@MyColumn(title = "标签")
	private String tags;
	@MyColumn(title = "封面")
	private String cover;
	@MyColumn(title = "子内容数")
	private int childs;
	@MyColumn(title = "分数", order = true)
	private int scores;
	@MyColumn(title = "评论数", order = true)
	private int comments;
	@MyColumn(title = "点击数", order = true)
	private int clicks;
	@MyColumn(title = "发布日期", condition = true, order = true)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@Field(analyze = Analyze.NO)
	@DateBridge(resolution = Resolution.MILLISECOND)
	private Date publishDate;
	@MyColumn(title = "创建日期")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date createDate;
	@MyColumn(title = "状态", condition = true)
	private int status;
	@MyColumn(title = "已删除", condition = true)
	private boolean disabled;
	@MyColumn(title = "扩展字段1", condition = true)
	private String extend1;
	@MyColumn(title = "扩展字段2", condition = true)
	private String extend2;
	@MyColumn(title = "扩展字段3", condition = true)
	private String extend3;
	@MyColumn(title = "扩展字段4", condition = true)
	private String extend4;
	@MyColumn(title = "扩展数字字段1", condition = true)
	private String modelExtend1;
	@MyColumn(title = "扩展数字字段2", condition = true)
	private String modelExtend2;
	@MyColumn(title = "扩展数字字段3", condition = true)
	private String modelExtend3;
	@MyColumn(title = "扩展数字字段4", condition = true)
	private String modelExtend4;

	public CmsContent() {
	}

	public CmsContent(String title, int userId, int categoryId, int modelId, boolean isCopied, int childs, int scores,
			int comments, int clicks, Date publishDate, Date createDate, int status, boolean disabled) {
		this.title = title;
		this.userId = userId;
		this.categoryId = categoryId;
		this.modelId = modelId;
		this.isCopied = isCopied;
		this.childs = childs;
		this.scores = scores;
		this.comments = comments;
		this.clicks = clicks;
		this.publishDate = publishDate;
		this.createDate = createDate;
		this.status = status;
		this.disabled = disabled;
	}

	public CmsContent(String title, int userId, Integer deptId, int categoryId, int modelId, Integer parentId, boolean isCopied,
			String source, String sourceUrl, String author, String editor, String url, String description, String tags,
			String cover, int childs, int scores, int comments, int clicks, Date publishDate, Date createDate, int status,
			boolean disabled, String extend1, String extend2, String extend3, String extend4, String modelExtend1,
			String modelExtend2, String modelExtend3, String modelExtend4) {
		this.title = title;
		this.userId = userId;
		this.deptId = deptId;
		this.categoryId = categoryId;
		this.modelId = modelId;
		this.parentId = parentId;
		this.isCopied = isCopied;
		this.source = source;
		this.sourceUrl = sourceUrl;
		this.author = author;
		this.editor = editor;
		this.url = url;
		this.description = description;
		this.tags = tags;
		this.cover = cover;
		this.childs = childs;
		this.scores = scores;
		this.comments = comments;
		this.clicks = clicks;
		this.publishDate = publishDate;
		this.createDate = createDate;
		this.status = status;
		this.disabled = disabled;
		this.extend1 = extend1;
		this.extend2 = extend2;
		this.extend3 = extend3;
		this.extend4 = extend4;
		this.modelExtend1 = modelExtend1;
		this.modelExtend2 = modelExtend2;
		this.modelExtend3 = modelExtend3;
		this.modelExtend4 = modelExtend4;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "title", nullable = false)
	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@Column(name = "user_id", nullable = false)
	public int getUserId() {
		return this.userId;
	}

	public void setUserId(int userId) {
		this.userId = userId;
	}

	@Column(name = "dept_id")
	public Integer getDeptId() {
		return this.deptId;
	}

	public void setDeptId(Integer deptId) {
		this.deptId = deptId;
	}

	@Column(name = "category_id", nullable = false)
	public int getCategoryId() {
		return this.categoryId;
	}

	public void setCategoryId(int categoryId) {
		this.categoryId = categoryId;
	}

	@Column(name = "model_id", nullable = false)
	public int getModelId() {
		return this.modelId;
	}

	public void setModelId(int modelId) {
		this.modelId = modelId;
	}

	@Column(name = "parent_id")
	public Integer getParentId() {
		return this.parentId;
	}

	public void setParentId(Integer parentId) {
		this.parentId = parentId;
	}

	@Column(name = "is_copied", nullable = false)
	public boolean isIsCopied() {
		return this.isCopied;
	}

	public void setIsCopied(boolean isCopied) {
		this.isCopied = isCopied;
	}

	@Column(name = "source", length = 50)
	public String getSource() {
		return this.source;
	}

	public void setSource(String source) {
		this.source = source;
	}

	@Column(name = "source_url")
	public String getSourceUrl() {
		return this.sourceUrl;
	}

	public void setSourceUrl(String sourceUrl) {
		this.sourceUrl = sourceUrl;
	}

	@Column(name = "author", length = 50)
	public String getAuthor() {
		return this.author;
	}

	public void setAuthor(String author) {
		this.author = author;
	}

	@Column(name = "editor", length = 50)
	public String getEditor() {
		return this.editor;
	}

	public void setEditor(String editor) {
		this.editor = editor;
	}

	@Column(name = "url")
	public String getUrl() {
		return this.url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	@Column(name = "description", length = 300)
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Column(name = "tags", length = 100)
	public String getTags() {
		return this.tags;
	}

	public void setTags(String tags) {
		this.tags = tags;
	}

	@Column(name = "cover")
	public String getCover() {
		return this.cover;
	}

	public void setCover(String cover) {
		this.cover = cover;
	}

	@Column(name = "childs", nullable = false)
	public int getChilds() {
		return this.childs;
	}

	public void setChilds(int childs) {
		this.childs = childs;
	}

	@Column(name = "scores", nullable = false)
	public int getScores() {
		return this.scores;
	}

	public void setScores(int scores) {
		this.scores = scores;
	}

	@Column(name = "comments", nullable = false)
	public int getComments() {
		return this.comments;
	}

	public void setComments(int comments) {
		this.comments = comments;
	}

	@Column(name = "clicks", nullable = false)
	public int getClicks() {
		return this.clicks;
	}

	public void setClicks(int clicks) {
		this.clicks = clicks;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "publish_date", nullable = false, length = 19)
	public Date getPublishDate() {
		return this.publishDate;
	}

	public void setPublishDate(Date publishDate) {
		this.publishDate = publishDate;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "create_date", nullable = false, length = 19)
	public Date getCreateDate() {
		return this.createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	@Column(name = "status", nullable = false)
	public int getStatus() {
		return this.status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	@Column(name = "disabled", nullable = false)
	public boolean isDisabled() {
		return this.disabled;
	}

	public void setDisabled(boolean disabled) {
		this.disabled = disabled;
	}

	@Column(name = "extend1", length = 100)
	public String getExtend1() {
		return this.extend1;
	}

	public void setExtend1(String extend1) {
		this.extend1 = extend1;
	}

	@Column(name = "extend2", length = 100)
	public String getExtend2() {
		return this.extend2;
	}

	public void setExtend2(String extend2) {
		this.extend2 = extend2;
	}

	@Column(name = "extend3", length = 100)
	public String getExtend3() {
		return this.extend3;
	}

	public void setExtend3(String extend3) {
		this.extend3 = extend3;
	}

	@Column(name = "extend4", length = 100)
	public String getExtend4() {
		return this.extend4;
	}

	public void setExtend4(String extend4) {
		this.extend4 = extend4;
	}

	@Column(name = "model_extend1", length = 100)
	public String getModelExtend1() {
		return this.modelExtend1;
	}

	public void setModelExtend1(String modelExtend1) {
		this.modelExtend1 = modelExtend1;
	}

	@Column(name = "model_extend2", length = 100)
	public String getModelExtend2() {
		return this.modelExtend2;
	}

	public void setModelExtend2(String modelExtend2) {
		this.modelExtend2 = modelExtend2;
	}

	@Column(name = "model_extend3", length = 100)
	public String getModelExtend3() {
		return this.modelExtend3;
	}

	public void setModelExtend3(String modelExtend3) {
		this.modelExtend3 = modelExtend3;
	}

	@Column(name = "model_extend4", length = 100)
	public String getModelExtend4() {
		return this.modelExtend4;
	}

	public void setModelExtend4(String modelExtend4) {
		this.modelExtend4 = modelExtend4;
	}

}
